package chap7.list;

import java.util.Comparator;

public class Car implements Comparable<Car>, Comparator<Car>{

	Integer carNo;
	String colour;
	String owner;
	
	public Car() {
		
	}
	
	public Car(Integer no, String color, String owner) {
		this.carNo = no;
		this.colour = color;
		this.owner = owner;
	}

	@Override
	public int compareTo(Car c) {
		return this.carNo.compareTo(c.carNo);
		
	}

	@Override
	public int compare(Car c1, Car c2) {
		return c1.carNo.compareTo(c2.carNo);		
	}
}
